package com.rui.patterns.decorator;

/**
 * @author : [锐神NO.3]
 * @version : [v1.0]
 * @className : Client
 * @createTime : [2022/2/22 16:30]
 * @description : [描述该类的功能]
 */

public class Client {
    public static void main(String[] args) {
        //点一份炒饭
        FastFood food = new FriedRice();

        //炒饭的价格
        System.out.println(food.getDesc() + "  " + food.cost() + "元");

        System.out.println("----------------------------------");

        //在上面的炒饭中加一个鸡蛋
        food = new Egg(food);
        System.out.println(food.getDesc() + "  " + food.cost() + "元");

        System.out.println("----------------------------------");

        //再加一个鸡蛋
        food = new Egg(food);
        System.out.println(food.getDesc() + "  " + food.cost() + "元");

        System.out.println("----------------------------------");

        //加一个培根
        food = new Bacon(food);
        System.out.println(food.getDesc() + "  " + food.cost() + "元");
    }
}
